import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'base_machine' })
export default class BaseMachine extends BaseEntity {
  @Column({ type: 'varchar', length: 50, unique: true, name: 'machine_code', comment: '设备编码' })
  @ApiProperty()
  machineCode: string;

  @Column({ type: 'varchar', length: 50, name: 'machine_name', comment: '设备名称' })
  @ApiProperty()
  machineName: string;

  @Column({
    type: 'varchar',
    length: 50,
    name: 'machine_model',
    comment: '设备型号',
    nullable: true,
  })
  @ApiProperty()
  machineModel: string;

  @Column({ type: 'float', nullable: true, name: 'unit_num', comment: '单元个数' })
  @ApiProperty()
  unitNum: number;

  @Column({ type: 'varchar', nullable: true, comment: '设备MAC' })
  @ApiProperty()
  mac: string;

  @Column({ type: 'varchar', nullable: true, comment: 'IP' })
  @ApiProperty()
  ip: string;

  @Column({ type: 'varchar', nullable: true, comment: '设备厂家' })
  @ApiProperty()
  factoryName: string;

  @Column({ type: 'varchar', nullable: true, comment: '设备标识' })
  @ApiProperty()
  factoryChildName: string;

  @Column({
    type: 'float',
    nullable: true,
    name: 'has_clean_up_unit',
    comment: '是否有清废单元',
  })
  @ApiProperty()
  hasCleanUpUnit: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'has_die_cutting_unit',
    comment: '是否有模切单元',
  })
  @ApiProperty()
  hasDieCuttingUnit: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'has_slotted_unit',
    comment: '是否有开槽单元',
  })
  @ApiProperty()
  hasSlottedUnit: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'has_preloading_unit',
    comment: '是否有预压单元',
  })
  @ApiProperty()
  hasPreloadingUnit: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'has_feeding_unit',
    comment: '是否有送纸单元',
  })
  @ApiProperty()
  hasFeedingUnit: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'machine_status_negation',
    comment: '设备状态取反',
  })
  @ApiProperty()
  machineStatusNegation: number;

  @Column({
    type: 'float',
    nullable: true,
    name: 'paper_status_negation',
    comment: '送纸状态取反',
  })
  @ApiProperty()
  paperStatusNegation: number;

  @Column({ type: 'varchar', name: 'machine_picture', nullable: true, comment: '设备图片' })
  @ApiProperty()
  machinePicture: string;

  @Column({ type: 'varchar', nullable: true, comment: '备注' })
  @ApiProperty()
  remark: string;
}
